package com.lcpress.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.lcpress.entity.Article;

public interface ArticleMapper {
	
	/*@Insert("insert into lcpress_users(username,password) values(#{username},#{password})")
	int add(UserEntity userEntity);
	
	@Select("select * from lcpress_users")
	List<UserEntity> getAllUsers();
	
	@Update("update lcpress_users set username=#{username},password=#{password} where id = #{id}")
    int update(UserEntity userEntity);*/
	
	@Select("select * from lcpress_articles ORDER BY id LIMIT #{start}, #{end}")
	List<Article> getArticlesByPage(int start,int end);
	
	@Select("select * from lcpress_articles")
	List<Article> getAllArticles();
	
	@Insert("insert into lcpress_articles(title,content) values(#{title},#{content})")
	int add(String title,String content);
	
}
